<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5-模板字符串中可以调用函数</title>
</head>
<body>
    <script>
        function died(){
            return 10;
        }

        let str = `乌克兰军队放水淹村庄阻挡俄军,死了${died()}人。`;
        console.log(str);

        function mobile(){
            return {
                id:10,
                name:'华为p30',
                price:2998
            };
        }

        let mstr = `
            手机品牌是${mobile().name},价格是${mobile().price},ID是${mobile().id}
        `;
        console.log(mstr);
    </script>
</body>
</html>